package com.xxx.ads;

/**
 * @version v1.0
 * @Description
 * @Author admin
 * @date 2021/7/14  13:45
 * @Copyright
 */
public class Rectangle {
    //矩形长
    private double length;
    //宽
    private  double width;

    //构造方法，有参
    public Rectangle() {
    }

    //无参
    public Rectangle(double length, double width) {
        this.length = length;
        this.width = width;
    }

    //get和set方法
    public double getLength() {
        return length;
    }

    public void setLength(double length) {
        this.length = length;
    }

    public double getWidth() {
        return width;
    }

    public void setWidth(double width) {
        this.width = width;
    }

    //面积
    public double area(){
        return length * width;
    }

    //周长
    public  double perimter(){
        return (length+width)*2;
    }

}
